package com.jamy.song;

import com.jamy.song.dao.UserDao;
import com.jamy.song.utils.JDBCUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Demo {


    private final static Logger logger = LoggerFactory.getLogger(Demo.class);

    public static void main(String[] args) {
        System.out.println("执行dao方法开始时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        UserDao dao = new UserDao(JDBCUtil.getConn(), null);
        try {
            //dao.insertData();
            dao.readFileUpdateDatabaseCommit("G:\\user.txt");
            System.out.println("执行dao方法结束时间:" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
        } catch (Exception e) {
            System.out.println("执行dao方法异常:"+ e);
            System.exit(1);
        }
        System.exit(0);
    }
}
